package com.slz3.business.module.wmsManagement.wmsPurchaseOrderLine.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.wmsManagement.wmsPurchaseOrderLine.domain.WmsPurchaseOrderLine;
import com.slz3.business.module.wmsManagement.wmsPurchaseOrderLine.domain.WmsPurchaseOrderLineCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class WmsPurchaseOrderLineResController extends WmsPurchaseOrderLineResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, WmsPurchaseOrderLine wmsPurchaseOrderLine) {
        if (WmsPurchaseOrderLineResUnsafeValid.add(req, wmsPurchaseOrderLine)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLine);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, WmsPurchaseOrderLineCondition wmsPurchaseOrderLineCondition) {
        if (WmsPurchaseOrderLineResUnsafeValid.delete(req, wmsPurchaseOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLineCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, WmsPurchaseOrderLine wmsPurchaseOrderLine) {
        if (WmsPurchaseOrderLineResUnsafeValid.modify(req, wmsPurchaseOrderLine)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLine);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (WmsPurchaseOrderLineResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return wmsPurchaseOrderLineResAtomic.info_$WmsPurchaseOrderLineUpdateLock(req);
        if (WmsPurchaseOrderLineResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$WmsPurchaseOrderLineUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (WmsPurchaseOrderLineResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, WmsPurchaseOrderLineCondition wmsPurchaseOrderLineCondition) {
        //
        if (WmsPurchaseOrderLineResUnsafeValid.auditSubmit(req, wmsPurchaseOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLineCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, WmsPurchaseOrderLineCondition wmsPurchaseOrderLineCondition) {
        if (WmsPurchaseOrderLineResUnsafeValid.audit(req, wmsPurchaseOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLineCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, WmsPurchaseOrderLineCondition wmsPurchaseOrderLineCondition) {
        if (WmsPurchaseOrderLineResUnsafeValid.auditReject(req, wmsPurchaseOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLineCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, WmsPurchaseOrderLineCondition wmsPurchaseOrderLineCondition) {
        if (WmsPurchaseOrderLineResUnsafeValid.usingEnable(req, wmsPurchaseOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLineCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, WmsPurchaseOrderLineCondition wmsPurchaseOrderLineCondition) {
        if (WmsPurchaseOrderLineResUnsafeValid.usingDisable(req, wmsPurchaseOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$WmsPurchaseOrderLineUpdateLock(req, wmsPurchaseOrderLineCondition);
        }
    }

}
